import request from '@/utils/request'

// 查询商品借出单(es_lend_form)列表
export function listForm(query) {
  return request({
    url: '/system/form/list',
    method: 'get',
    params: query
  })
}

// 查询商品借出单(es_lend_form)详细
export function getForm(id) {
  return request({
    url: '/system/form/' + id,
    method: 'get'
  })
}

// 新增商品借出单(es_lend_form)
export function addForm(data) {
  return request({
    url: '/system/form',
    method: 'post',
    data: data
  })
}

// 修改商品借出单(es_lend_form)
export function updateForm(data) {
  return request({
    url: '/system/form',
    method: 'put',
    data: data
  })
}

// 删除商品借出单(es_lend_form)
export function delForm(id) {
  return request({
    url: '/system/form/' + id,
    method: 'delete'
  })
}

// 确认商品借出单
export function confirmForm(id) {
  return request({
    url: '/system/form/confirm/' + id,
    method: 'put'
  })
}

// 归还商品借出单
export function returnForm(id) {
  return request({
    url: '/system/form/return/' + id,
    method: 'put'
  })
}

// 查询可借出的商品列表
export function listAvailableProducts(query) {
  return request({
    url: '/system/form/availableProducts',
    method: 'get',
    params: query
  })
}
